﻿@model Apps.Models.Sys.SysSequenceModel
@using Apps.Web.Core;
@using Apps.Common;
@using Apps.Models.Sys;
@using Apps.Web;
@using Apps.Locale;
@using Apps.Models.Sys;
@{
    ViewBag.Title = "创建";
    Layout = "~/Views/Shared/_Index_LayoutEdit.cshtml";
    List<permModel> perm = null;
}

<script type="text/javascript">
$(function () {
    $("#btnSave").click(function () {
        if ($("form").valid()) {
            $.ajax({
                url: "@Url.Action("Create")",
                type: "Post",
                data: $("form").serialize(),
                dataType: "json",
                success: function (data) {
                    if (data.type == 1) {
                        window.parent.frameReturnByMes(data.message);
                        window.parent.frameReturnByReload(true);
                        window.parent.frameReturnByClose()
                    }
                    else {
                        window.parent.frameReturnByMes(data.message);
                    }
                }
            });
        }
        return false;
    });
    $("#btnReturn").click(function () {
         window.parent.frameReturnByClose();
    });
});
function frameReturnByClose() {
$("#modalwindow").window('close');
}
function frameReturnByMes(mes) {
$.messageBox5s(Lang.Tip, mes);
}
</script>
<div id="modalwindow" class="easyui-window" style="width:800px; height:400px;" data-options="modal:true,closed:true,minimizable:false,shadow:false"></div>
<div class="mvctool bgb">
@Html.ToolButton("btnSave", "fa fa-save", Resource.Save,ref perm, "Save", true)
@Html.ToolButton("btnReturn", "fa fa-reply", Resource.Reply,false)
</div>
@using (Html.BeginForm())
{
             @Html.HiddenFor(model => model.Id, new { @Value = 0})
 <table class="formtable">
     <tbody>
         <tr>
             <th>
                 @Html.LabelFor(model => model.TabName)：
             </th>
             <td>
                 @Html.EditorFor(model => model.TabName)
             </td>
             <td>@Html.ValidationMessageFor(model => model.TabName)</td>
         </tr>
         <tr>
             <th>
                 @Html.LabelFor(model => model.FirstType)：
             </th>
             <td>
                 @Html.DropDownListFor(model => model.FirstTypeEnum, ViewBag.SequenceTypes as SelectList)
             </td>
             <td>@Html.ValidationMessageFor(model => model.FirstTypeEnum)</td>
         </tr>
         <tr>
             <th>
                 @Html.LabelFor(model => model.FirstRule)：
             </th>
             <td>
                 @Html.EditorFor(model => model.FirstRule)
             </td>
             <td>@Html.ValidationMessageFor(model => model.FirstRule)</td>
         </tr>
         <tr>
             <th>
                 @Html.LabelFor(model => model.FirstLength)：
             </th>
             <td>
                 @Html.EditorFor(model => model.FirstLength)
             </td>
             <td>@Html.ValidationMessageFor(model => model.FirstLength)</td>
         </tr>
         <tr>
             <th>
                 @Html.LabelFor(model => model.JoinChar)：
             </th>
             <td>
                 @Html.EditorFor(model => model.JoinChar)
             </td>
             <td>@Html.ValidationMessageFor(model => model.JoinChar)</td>
         </tr>
         <tr>
             <th>
                 @Html.LabelFor(model => model.SecondType)：
             </th>
             <td>
                 @Html.DropDownListFor(model => model.SecondTypeEnum, ViewBag.SequenceTypes as SelectList)
             </td>
             <td>@Html.ValidationMessageFor(model => model.SecondTypeEnum)</td>
         </tr>
         <tr>
             <th>
                 @Html.LabelFor(model => model.SecondRule)：
             </th>
             <td>
                 @Html.EditorFor(model => model.SecondRule)
             </td>
             <td>@Html.ValidationMessageFor(model => model.SecondRule)</td>
         </tr>
         <tr>
             <th>
                 @Html.LabelFor(model => model.SecondLength)：
             </th>
             <td>
                 @Html.EditorFor(model => model.SecondLength)
             </td>
             <td>@Html.ValidationMessageFor(model => model.SecondLength)</td>
         </tr>
         <tr>
             <th>
                 @Html.LabelFor(model => model.Remark)：
             </th>
             <td>
                 @Html.EditorFor(model => model.Remark)
             </td>
             <td>@Html.ValidationMessageFor(model => model.Remark)</td>
         </tr>
     </tbody>
</table>
}

